<?php 
	$cs = Yii::app()->clientScript;
	$theme_path = yii::app()->theme->basePath;
	$theme_url = yii::app()->theme->baseUrl;
	
	//包含基本样式、脚本
	$cs->registerCoreScript('jquery');
	$cs->registerScriptFile($theme_url . '/js/site.js', CClientScript::POS_END);
	$cs->registerScriptFile('/js/common.js', CClientScript::POS_END);
	$cs->registerCssFile($theme_url . '/css/site.css');
	
	//尝试包含当前页面样式及脚本
	$action_resource = $this->id . '_' . $this->action->id;
	if(file_exists($theme_path . '/js/page/' . $action_resource . '.js')){
		$cs->registerScriptFile($theme_url . '/js/page/' . $action_resource . '.js', CClientScript::POS_END);
	}
	if(file_exists($theme_path . '/css/page/' . $action_resource . '.css')){
		$cs->registerCssFile($theme_url . '/css/page/' . $action_resource . '.css');
	}
	$cs->registerScript('common', 'var THEME = "' . yii::app()->theme->name . '";', CClientScript::POS_END);
?>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="language" content="zh-cn" />
		<meta name="keywords" content=""/>
		<meta name="description" content=""/>
		<title><?php echo CHtml::encode($this->pageTitle); ?></title>
	</head>
	<body>
		<?php 
		if(!empty($this->site_info)){
			echo CHtml::tag('div', array('id'=>'site_info'), $this->site_info);
		}
		?>
		<div id="header">
			<div class="wrap_1000">
				欢迎光临<?php echo Yii::app()->name?>，<span id="author_info">正在加载用户信息...</span>
				<?php 
				$this->widget('application.widget.nav.NavWidget', array(
					'code' 	=> 'header_nav',
					'tpl'	=> 'text_link',
					'id'	=> 'right_nav'
				));
				?>
			</div>
		</div>
		<div id="main_nav">
			<div class="wrap_1000">
				<h2><a href="/"><?php echo CHtml::image($this->logo, Yii::app()->name)?></a></h2>
				<?php 
				$this->widget('application.widget.nav.NavWidget', array(
					'code' => 'main_nav'
				));
				?>
			</div>
		</div>
		<div id="navbar">
			<div class="wrap_1000">
				<?php 
				$this->widget('application.widget.goods_cate.GoodsCateListWidget', array(
					'title' => '商城所有分类',
					'tpl' 	=> 'slider',
					'count' => 20
				));
				?>
				<div id="navbar_right">
					<?php 
					$this->widget('application.widget.common.SearcherWidget', array(
						'tips' 	=> '商城所有分类',
						'id' 	=> 'searchor'
					));
					?>
				</div>
				
			</div>
		</div>
		<div class="wrap_1000" id="main_content">
		<?php 
			if(isset($this->breadcrumbs)){
				$this->widget('zii.widgets.CBreadcrumbs', array(
					'links' => $this->breadcrumbs,
				)); 
			}
			echo $content;
		?>
		</div>
		
		<div id="footer">
			<div class="wrap_1000">
			<?php 
			$this->widget('application.widget.nav.NavWidget', array(
				'code' 	=> 'bottom_nav',
				'tpl' 	=> 'bottom_nav'
			));
			?>
			</div>
		</div>
	</body>
</html>
